#include <stdio.h>

int main () {
	char input;
	int sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;
	while (scanf("%c", &input) && input != '\n') {
		if (input >= '0' && input <= '9') {
			sum3++;
		} else if (input == ' ') {
			sum2++;
		} else if ((input >= 'a' && input <= 'z') || (input >= 'A' && input <= 'Z')) {
			sum1++;
		} else {
			sum4++;
		}
	}
	printf("%d %d %d %d\n", sum1, sum2, sum3, sum4);
	return 0;
}